home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / showbox.com / SHOWBOX.HPP < prev   
Encoding:
C/C++ Source or Header  |  1993-06-01  |  1.6 KB  |  83 lines

  1.  
  2.  
  3. /*
  4.  *
  5.  *
  6.  *    $Revision:   1.1  $
  7.  *
  8.  *
  9.  *
  10.  *
  11.  *    $Log:   C:/pbmdtsts/include/showbox.hpv  $
  12.    
  13.       Rev 1.1   20 May 1993 11:07:50   C_BAKER
  14.    
  15.    This revision appears to clear up the problem of the
  16.    heap not being restored properly when the class is destroyed.
  17.    
  18.       Rev 1.0   19 May 1993 13:30:12   C_BAKER
  19.    Initial revision.
  20.  *
  21. */
  22. #ifndef SHOWBOXCLASS
  23. #define SHOWBOXCLASS
  24.  
  25. inline int min(int a, int b) 
  26. {
  27.     return ( (a < b) ? a : b ); 
  28. }
  29.  
  30. inline int max(int a, int b) 
  31. {
  32.     return ( (a > b) ? a : b ); 
  33. }
  34.  
  35.  
  36. class Box {
  37. unsigned char far * BaseScreen;
  38. unsigned char far * WorkScreen;
  39. ushort BoxWidth;
  40. ushort BoxHite;
  41. int Xpos, Ypos;
  42. uchar Attrib;        // requested attribute
  43. char AbsPos;
  44.  
  45. int BreakLineInx;
  46. char * Brokenlines[20];    // pointers used to break up lines
  47.  
  48. char RetChar;
  49. char *LMsg;        // pointer to storage allocated for message
  50. char *LTitle;        // pointer to storage allocated for title
  51. char *SavedScreenArea;    // pointer to storage allocated for underlying screen area
  52.  
  53. void BuildTheBox(void);
  54. void MessageInBox(void);
  55. void TitleOnBox(void);
  56. void FillTheBox(void);
  57. void ShadeTheBox(void);
  58. void SaveScreenArea(void);
  59. void RestoreScreenArea(void);
  60. void BreakLine ( int inx, char ** ptr );
  61. void BreakupMessage(void);
  62.  
  63. public:
  64. Box ( char * Title, char * Msg, int Xpos, int Ypos, uchar Attrib );
  65. Box ( char * Title, int Xpos, int Ypos, uchar Attrib );
  66. Box ( char * Title, char * Msg, uchar ReqAttrib );
  67. ~Box(void);
  68. void Redraw(char *);
  69.  
  70. };
  71.  
  72. class ErrorBox : Box {
  73.  
  74. public:
  75. ErrorBox( char * Msg, int Continuous );
  76. ErrorBox( char * Msg );
  77.  
  78. };
  79.  
  80. #endif
  81.  
  82.  
  83.